<style>
.s_nav{float:left;padding:10px 20px;font-size:12px;background:#fcfcfc;}
.s_nav ul{float:left;padding:5px 0;}
.s_nav ul.heng{border-bottom:#ddd dotted 1px;}
.s_nav li{float:left;line-height:22px;width:100%;}
.s_nav .inp{float:left;padding:3px; width:300px;height:20px;border:#CCCCCC solid 1px;background:#fff;}
.s_nav .layui-btn{padding:0 20px;}
</style>
<form class="layui-form">
<div class='s_nav'>
<ul>
 <li><strong>连接名称：</strong></li>
 <li><input name="title" lay-verify="title" style='width:150px;' value='{$row.tit}' class="layui-input" type="text" /> 
</li>
</ul>
<ul>
 <li><strong>连接地址：</strong></li>
 <li><input name="link" lay-verify="link"  value='{if($row.link==null)}http://{else}{$row.link}{/if}' class="layui-input" type="text" /></li>
 <li style='color:#666'>只能添加【{:sysconf('site_name')}】站内链接</li>
</ul>
<ul class='kefu_bottom'>
 <li><input type="button" class="layui-btn layui-btn-normal layui-btn-small"  lay-filter="nav" lay-submit="" value="保存"/></li>
 </ul>
</div>
<input type="hidden" value="1" name="layer" />
<input type="hidden" value="{$row.id}" name="id" />
<input type="hidden" value="{$action}" name="data" />
<input type="hidden" value="nav" name="object" />
</form>
<script language="javascript">
 layui.use('form', function(){
  var form = layui.form();
	 form.verify({
		title: function(value){
			  if(value.length<2 || value.length>7) return "【连接名称】字数需为2~6位";
		},
		link: function(value){
			  if((value.substring(0,7).indexOf("http://")==-1 && value.substring(0,8).indexOf("https://")==-1)|| value.substring(0,24).indexOf("{:sysconf('site_domain')}")==-1) return "【连接地址】需为【{:sysconf('site_name')}】站内链接，且需以http://或https://开头";
		}
	});

	form.on('submit(nav)', function(data) {
		progress(true);
		Aform('shop_admin',data.field);
		return false;
	});

 });

</script>